package factory;

/**
 * @ClassName SimpleFactoryPatterm
 * @Description TODO
 * @Author leejiliang
 * @DateTime 2021/7/12 18:01
 * @Version 1.0
 */
public class ConnectionFactory {
	public static Connection getConnection(String  type) {
		if ("MySQL".equalsIgnoreCase(type)) {
			return new MySQLConnection();
		} else if ("oracle".equalsIgnoreCase(type)) {
			return new OracleConnection();
		} else {
			throw new IllegalArgumentException("不支持的类型");
		}
	}
}
